//{====================================================================================
//! @file Var2taskBotv.c
//! @date    2013-09-29 21:03
//! @author Andrianov Georgiy <egor.andrianov81@gmail.com>
//!
//! Programm simplifies root of number
//!
//! @par The programm number
//!      The programm outputs number of the rational part
//!                       and numger of the irrational part
//}====================================================================================

#include <stdio.h>
#include <math.h>
#include <assert.h>

long normalisation(long y, long* b);
int kvadro(long a, long* x);
int proverka(long b);

int main()
{
    long n = 0, a = 0, b = 0;
    scanf("%i", &n);
    a = normalisation(n, &b);
    printf("%i %i", a, b);
    return 0;
}

//! normalisation - simplifies root of number
//!
//! @param      y   number
//!
//! @param[out] b   irrational part of answer
//!
//! @return     rational part of answer

long normalisation(long y, long* b)
{
    long delitel = 0;
    long k = 1;
    while (kvadro(y, &delitel) == 1)
    {
        y = y / delitel;
        k = k * sqrt(delitel);
        //printf("This is K and Y %i %i", k, y);
    }
    *b = k;
    return y;
}

//! kvadro - determine are there any sqaures among divisors of number
//!
//! @param      a   number
//!
//!@param[out]  x   square-divisor of number
//!
//! @return         1 - if there are sqaures among divisors of number
//!                 0 - if there are no sqaures among divisors of number

int kvadro(long a, long* x)
{
    assert (x != NULL);
    long i = 0;
    for (i = 2; i <= a; i++)
    {
        if ((a % i == 0) && (proverka(i) == 1))
        {
            *x = i;
            return 1;
        }
    }
    return 0;
}

//! proverka - determine is number square of other number or not
//!
//! @param      a   number
//!
//! @return         1 - if number is square of other number
//!                 0 - if number is not square of other number

int proverka(long a)
{
    long j = 0;
    for (j = 0; j <= sqrt(a); j++)
    {
        if (a == j*j)
        {
            return 1;
        }
    }
    return 0;
}
